(1) Field of the Invention
The present invention is related to the field of object-oriented programming languages, more specifically, the present invention is related to mixed-mode execution for object-oriented programming languages in ways such that a higher-level mode of execution and a lower-level mode of execution can be used together.
(2) Background
Traditionally, to execute programs using an interpreted object-oriented programming language such as Java or Smalltalk, the programmer writes source code. The source code is then processed by a compiler to produce byte code. Byte code is a low-level representation of the program optimized for efficient interpretation. The program is then interpreted by feeding the byte code to a virtual machine that understands the instructions within the byte code and executes them accordingly.
An alternate strategy to having a virtual machine execute the byte code instructions is to have a source code interpreter that directly operates on the source code. There are several advantages of using this strategy. For one, the source code interpreter has access to the program at its highest level of abstraction (as it was written by the programmer) and therefore it can extract the maximum possible information about the program and its execution. Further, the source code interpreter can execute partially written source code which in some cases, may not be translated into byte code by a compiler.
During the development of programs, it is important for the programmer to have access to various different kinds of information to facilitate maintaining and improving their programs. At the same time, it is important for the programmer to have the program run as quickly as possible.
It is therefore desirable, especially in environments such as Java, where the byte code and virtual machines are highly standardized, to use an alternate source code interpreter that provides more flexibility to implement features that are missing from the standardized byte code/virtual machines. Further, it is desirable to find ways in which a higher-level mode of execution such as a source code interpreter and a lower-level mode of execution such as a virtual machine executing byte code can be used together, such that the higher-level mode of execution executes source code for specific portions of the program whenever detailed information is desired, while the lower-level mode of execution is used at all other times.